//引入express模块
const express=require('express');
//引入连接池对象
const pool=require('../pool.js');
//console.log(pool);
//const app=express();
//创建路由器对象
const r=express.Router();
// 油价接口（get  /familyson）
r.get('',(req,res)=>{
    const p=req.query.pid
    const t=req.query.updatetime
    console.log(p);
    pool.query('SELECT CAST(oil_95 AS CHAR) oil_92,pname FROM oil_family,area_list where oid=pid and pid=? and updatetime=?',[p,t],(err,result)=>{
        if(err){
            next(err);
            return;
        }else{
        console.log(result);
    }
        res.send(result);
    })
})




//暴露(导出)路由器对象
module.exports=r;